package com.wenyl.juc.thread.readWriteLockTest;

import lombok.Data;

import java.util.concurrent.locks.ReadWriteLock;

/**
 * @author Swimming Dragon
 * @description: TODO
 * @date 2024年11月07日 12:02
 */
@Data
public class MyCount {
    private String id;
    private int cash;
    public MyCount(String id,int cash){
        this.id = id;
        this.cash = cash;
    }
    public int getCash(){
        System.out.println(Thread.currentThread().getName()+"  getCash cash = "+cash);
        return this.cash;
    }
    public void setCash(int newCash){
        System.out.println(Thread.currentThread().getName()+"  getCash cash = "+cash);
        this.cash = newCash;
    }
}
